package lesson3;

import java.io.File;

public class Demo1 {
    public static void main(String[] args) {
        //File file = new File("TestFile/1.txt");
        //File file = new File("TestFile"+File.separator+"1.txt");
        //File file = new File("file"+File.separator+"file1"+File.separator+"11231.txt");
        File file = new File("C:\\Users\\Administrator\\Desktop\\TestFile\\1.txt");
        if(file.isDirectory()){
            System.out.println("我是文件夹");
        }

        if(file.isFile()){
            System.out.println("我是文件");
        }

        if(file.isHidden()){
            System.out.println("隐藏文件");
        }

        file.renameTo(new File("C:\\Users\\Administrator\\Desktop\\TestFile\\2.txt"));
    }
}
